import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Practice3 {
    //https://www.nowcoder.com/questionTerminal/9fbb4d95e6164cd9ab52e859fbe8f4ec
    //哈希表
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        Set<String> set = new HashSet<>();
        for(int i = 0;i < n;i++){
            char[] s = in.next().toCharArray();
            Arrays.sort(s);
            set.add(new String(s));//我开始用s.toString()这个返回值是一个数组的引用地址,要用new String()才能转化成字符串
        }
        System.out.println(set.size());
    }
}
